<template>
    <van-nav-bar title="搜索">
        <template #left>
            <router-link to="/city" tag="div">城市</router-link>
        </template>
        <template #title>
            <!-- <van-search v-model="value" placeholder="请输入搜索关键词" /> -->
            <router-link to="/search" tag="div">卡姿兰大眼睛</router-link>
        </template>
        <template #right>
            <!--  userId 有表示登录 没有就登录 点击跳转到登陆  -->

            <!-- 如何获取用户id   pinia  本地缓存 -->

            <router-link to="/user" tag="div" v-if="userId">我的</router-link>
            <router-link to="/login" tag="div" v-else>登录</router-link>
        </template>
    </van-nav-bar>

</template>

<script setup lang="ts">
import { ref, computed, onMounted, Ref } from 'vue';
import useUserStore from '@/pinia/index'
const userStore = useUserStore()
const userId = computed(() => userStore.userId)


</script>

<style scoped lang="scss">

</style>